import fetch from '@/utils/fetch'

export function getCaptcha() {
  return fetch({
    url: '/api/v1/home/validateCode',
    method: 'get'
  })
}

export function login(loginDto) {
  return fetch({
    url: '/api/v1/home/login',
    method: 'post',
    data: loginDto
  })
}

export function logout() {
  return fetch({
    url: '/api/v1/home/logout',
    method: 'get'
  })
}

export function apiGetMenuList() {
  return fetch({
    url: '/api/v1/user/menu',
    method: 'get'
  })
}

export function apiGetBacklogList() {
  return fetch({
    url: 'api/v1/home/backlogList',
    method: 'get',
    params: {}
  })
}

export function apiChangePassword(passwordDto) {
  return fetch({
    url: '/api/v1/user/password',
    method: 'put',
    data: passwordDto
  })
}
